package cn.magictodo.weblog.common.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * 业务异常类
 *
 * @author liu
 * @time 2023-11-15 00:35
 */
@Getter
@Setter
public class BizException extends RuntimeException{
    // 异常码
    private String errorCode;
    // 错误信息，用于提供给调用者
    private String errorMessage;

    public BizException(BaseExceptionInterface baseExceptionInterface) {
        this.errorCode = baseExceptionInterface.getErrorCode();
        this.errorMessage = baseExceptionInterface.getErrorMessage();
    }
}
